from testudo import Assert

class AssertionTests ():
	def test_assert_is_true_for_false(self):
		try:
			Assert.is_true(False)
		except Assert.AssertionException, exception:
			Assert.are_equal("Expected [True] but was [False].", exception.message)
		else:
			Assert.fail("Assert.is_true should fail.")

	def test_assert_is_true_for_false_with_message(self):
		try:
			Assert.is_true(False, "my message")
		except Assert.AssertionException, exception:
			Assert.are_equal("Expected [True] but was [False]. my message", exception.message)
		else:
			Assert.fail("Assert.is_true should fail with the correct message.")
	
	def test_assert_is_true_for_true(self):
		Assert.is_true(True)
		
	def test_assert_are_equal_for_5_and_3(self):
		try:
			Assert.are_equal(5, 3)
		except Assert.AssertionException, exception:
			Assert.are_equal("Expected [5] but was [3].", exception.message)
		else:
			Assert.fail("Assert.are_equal should fail.")

	def test_assert_are_equal_for_5_and_4_with_message(self):
		try:
			Assert.are_equal(5, 4, "my message")
		except Assert.AssertionException, exception:
			Assert.are_equal("Expected [5] but was [4]. my message", exception.message)
		else:
			Assert.fail("Assert.are_equal should fail with the correct message.")
		
	def test_assert_are_equal_for_12_and_12(self):
		Assert.are_equal(12, 12)
		
	def test_assert_are_not_equal_for_10_and_10(self):
		try:
			Assert.are_not_equal(10, 10)
		except Assert.AssertionException, exception:
			Assert.are_equal("Expected not [10] but was [10].", exception.message)
		else:
			Assert.fail("Assert.are_not_equal should fail.")
	
	def test_assert_not_equal_for_4_and_6(self):
		Assert.are_not_equal(4, 6)

	def test_assert_not_equal_for_5_and_5_with_message(self):
		try:
			Assert.are_not_equal(5, 5, "expected message")
		except Assert.AssertionException, exception:
			Assert.are_equal("Expected not [5] but was [5]. expected message", exception.message)
		else:
			Assert.fail("Assert.are_not_equal should fail with the correct message.")
			
	def test_assert_is_false_for_false(self):
		Assert.is_false(False)
		
	def test_assert_is_false_for_true(self):
		try:
			Assert.is_false(True)
		except Assert.AssertionException, exception:
			Assert.are_equal("Expected [False] but was [True].", exception.message)
		else:
			Assert.fail("Assert.is_false should fail.")
			
	def test_assert_is_false_for_true_with_message(self):
		try:
			Assert.is_false(True, "my message")
		except Assert.AssertionException, exception:
			Assert.are_equal("Expected [False] but was [True]. my message", exception.message)
		else:
			Assert.fail("Assert.is_false should fail with the correct message.")
		
	def test_is_none_for_not_none(self):
		try:
			Assert.is_none("not none")
		except Assert.AssertionException, exception:
			Assert.are_equal("Expected [None] but was [not none].", exception.message)
		else:
			Assert.fail("Assert.is_none should fail.")
	
	def test_is_none_for_none(self):
		Assert.is_none(None)
		
	def test_is_none_for_7(self):
		try:
			Assert.is_none(7)
		except Assert.AssertionException, exception:
			Assert.are_equal("Expected [None] but was [7].", exception.message)
		else:
			Assert.fail("Assert.is_none should fail.")
			
	def test_is_none_for_not_none_with_message(self):
		try:
			Assert.is_none("not none", "message")
		except Assert.AssertionException, exception:
			Assert.are_equal("Expected [None] but was [not none]. message", exception.message)
		else:
			Assert.fail("Assert.is_none should fail with the correct message.")
			
	def test_is_not_none_for_none(self):
		try:
			Assert.is_not_none(None)
		except Assert.AssertionException, exception:
			Assert.are_equal("Expected not [None] but was [None].", exception.message)
		else:
			Assert.fail("Assert.is_not_none should fail.")
			
	def test_is_not_none_for_not_none(self):
		Assert.is_not_none("not None")
		
	def test_is_not_none_for_none_with_message(self):
		try:
			Assert.is_not_none(None, "message")
		except Assert.AssertionException, exception:
			Assert.are_equal("Expected not [None] but was [None]. message", exception.message)
		else:
			Assert.fail("Assert.is_not_none should fail with the correct message.")
		
